package com.lanou.dllo.day14.other;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.StaggeredGridLayoutManager;
import android.view.View;
import android.widget.Button;

import com.lanou.dllo.day14.R;

/**
 * Created by dllo on 16/1/26.
 */
public class OtherActivity extends AppCompatActivity {

    private RecyclerView otherRv;
    private Button btn, btn1;
    private OtherAdapter otherAdapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_other);
        otherRv = (RecyclerView) findViewById(R.id.recycler);

        otherRv.setLayoutManager(new StaggeredGridLayoutManager(4, StaggeredGridLayoutManager.VERTICAL));
        otherAdapter = new OtherAdapter(this);
        otherRv.setAdapter(otherAdapter);

        findViewById(R.id.insetr_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                otherAdapter.insetToZero();

            }
        });
        findViewById(R.id.del_btn).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                //TODO 删除
                otherAdapter.desZero();

            }
        });

    }

}
